MATLAB implementation of the alpha scheme for the heat transfer problem
Below you can find a link to the MATLAB code performing simulations for the alpha scheme for the two-dimensional heat transport problem.
In line 621 we enter the time step size \( dt=0.01 \), in line 622 we enter the parameter
\( alpha=0.5 \), where alpha=0 means explicit Euler, alpha=1 implicit Euler, and alpha=0.5 means Cranck-Nicolson scheme.
In line 623 we specify the time steps number
\( K = 20; \)
The code execution is also possible in the free Octave environment.
Download code or see Appendix 7.
The code is activated by opening it in Octave and typing a command
\( heat\_time \)
During operation, the code prints successive time steps
Iter 1, t = 0.010000
Iter 2, t = 0.020000
Iter 3, t = 0.030000
...
The code generates a file at any time in the current directory out_*.png, e.g.
out_0.png
out_1.png
out_2.png
...
containing solutions from individual time steps.